home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44a.zip / MIS003.QM < prev    next >
Text File  |  1992-05-27  |  14KB  |  292 lines

  1. *                               mis003.qm
  2. *             Macros To Make Column Blocks of Longest Lines
  3. *                        Written By Tom Hogshead
  4. *                       [ See MISCxx.QM For Use ]
  5. *                                 5/19/92
  6. *  Key    Subfile              Description
  7. * =====  ==========  ====================================================
  8. *                    Make Block a Column Block of Longest Line
  9. * @(3)                ├─ Exclude Leading Spaces                           |chg
  10. * @(1)                ├─ Include Leading Spaces                           |chg
  11. * @(7)                └─ Include Leading Spaces (Use Nul, small ver of @1)
  12. *
  13. *                    Make Paragraph a Column Block of Longest Line
  14. * @(5)                ├─ Exclude Leading Spaces
  15. * @(2)                └─ Include Leading Spaces                           |chg
  16. *
  17. *                    Make 20 Tab Stop Wide Column Block,
  18. * @(8)                └─ Exclude Leading Spaces                           |new
  19. *
  20. * @(6)               Make File a Column Block of Longest Line
  21. * @(4)               Make a 73 Column Wide Column Block                   |chg
  22. *
  23. *                Convert Column Blocks . .
  24. * #(f3)                  Convert Vertical to Horizontal Column Block
  25. * #(f4)                  Convert Horizontal to Vertical Column Block
  26. * #(f5)                  Convert Vertical to Horizontal Column Block,
  27. *                        Horizontal Entries NOT Separated by Space
  28. * #(f6)                  Convert Horizontal to Vertical Column Block,
  29. *                        Horizontal Entries NOT Separated by Space
  30. *
  31. * #(F4__) {e:\up\com003} Surround Column-Blocked Text With
  32. *                        Box Of Desired Characters
  33. *                                             ********
  34. *                                   Box Drawn *Around* Outside Border
  35. *                                             ********
  36. *                                   Of Column Block, Juxtapose Text
  37. *
  38. * @(F4)   {e:\up\com003} Erase Outside Border Of Column-Blocked Text
  39. *                        and Collapse Text Surronding Block To Original
  40. *                        Position Before Box Was Made
  41. *
  42. *                 Macros to Right/Left Justify and Align . .
  43. * @(1)   {e:\up\rfr004}  Right Justify Column Block
  44. * @(2)   {e:\up\rfr004}  Left  Justify Column Block
  45. * @(3)   {e:\up\rfr004}  Align Column Block By Decimal Point
  46. * @(4)   {e:\up\rfr004}  Align Column Block By Decimal Point, Fill Zeros
  47. * @(5)   {e:\up\rfr004}  Comma Delineate and Align Column Block By
  48. *                        Decimal Point, Fill With Zeros
  49. * @(6)   {e:\up\rfr004}  Comma Delineate and Align Column Block By
  50. *                        Decimal Point, Fill With Zeros, Add $'s
  51. * @(9)   {e:\up\rfr004}  Right Justify Column
  52. * @(f1)  {e:\up\rfr004}  Right Justify Line or Block Using RJ.COM
  53. * @(f2)  {e:\up\rfr004}  Removes Right Justification From Line or Block
  54. * @(f3)  {e:\up\rfr004}  Right Justify FILE Using RJ.COM
  55. * @(f4)  {e:\up\rfr004}  Removes Right Justification From FILE
  56. * @(f5)  {e:\up\rfr004}  Right Justify FILE Using RJ.COM, Screen Preview
  57. * @(f8)  {e:\up\rfr004}  Left  Justify File
  58. * @(f7)  {e:\up\rfr004}  Left  Justify Lines Containing Any Type Block
  59. *                  Sort Column Block And Adjacent Text In:
  60. * @(1)   {e:\up\rfr009}  Ascending  Absolute Value
  61. * @(2)   {e:\up\rfr009}  Descending Absolute Value
  62. * @(3)   {e:\up\rfr009}  Ascending, Case Insensitive
  63. * @(4)   {e:\up\rfr009}  Descending
  64. * @(5)   {e:\up\rfr009}  Reverse
  65. *
  66. *                   Sort Column Block Only In:
  67. * @(6)   {e:\up\rfr009}  Ascending  Absolute Value
  68. * @(7)   {e:\up\rfr009}  Descending Absolute Value
  69. * @(8)   {e:\up\rfr009}  Ascending, Limited to 999 Lines
  70. * @(9)   {e:\up\rfr009}  Descending
  71. * @(0)   {e:\up\rfr009}  Randomly
  72. *
  73. *          {e:\up\MISC*} Return To MISCxx.QM
  74. *
  75. *-- eoi
  76.  
  77. *                          M A C R O S
  78. * ----------------------------------------------------------------------
  79. * @(1)  Make Column Block of Longest Line, Pause To Mark Block,
  80. *       Include Leading Spaces
  81. * ----------------------------------------------------------------------
  82. * Have you ever needed to mark a column block to include all the text
  83. * in each line and no trailing spaces after the longest line?  If so,
  84. * this macro may help.
  85.  
  86. * I found myself often having to:
  87. *         - mark block begin
  88. *         - cursor down to longest line
  89. *         - endline
  90. *         - cursor down to block end
  91. *         - close block
  92.  
  93. * This macro automates and does this, and also will convert an open or
  94. * closed line, character or column block to a column block of the width
  95. * of the longest line in the block.
  96.  
  97. * At the 'pause', cursor down to select lines, and press <enter> to make a
  98. * column block of the longest lines selected.  Alternatively, lines may
  99. * be marked as an open or closed line, character or column before macro
  100. * execution.  Macro requires QEdit v2.15.
  101.  
  102. @1      macrobegin
  103.         gotoblockbeg jtrue A  markline gotoblockbeg jtrue OK  pause jump B
  104.      A: gotoblockend unmarkblock markline prevposition
  105.      B: markline
  106.     OK: setscreenoff
  107.         gotoblockend begline addline "*" #173 gotoblockbeg begline markcolumn
  108.      1: endline cursorleft markcolumn cursordown
  109.         Find "*" #173 return delline return jfalse 2 prevposition          *|
  110.         jump 1
  111.      2: delline gotoblockbeg
  112. *
  113. * 74 bytes Sat  11-02-1991  17:45:48 (TH @1, #3/758
  114. * 70 bytes Mon  11-11-1991  12:04:28 (TH @1, changed routine)
  115. * 67 bytes Wed  11-20-1991  09:43:07 (TH @1, shortened, #3/774)
  116. * 63 bytes Sat  12-07-1991  14:28:09 (TH @1, shortened)
  117. * 64 bytes Sun  04-26-1992  12:07:14 (TH @1, added setscreenoff)
  118. * 54 bytes Tue  04-28-1992  08:11:14 (TH @1, shortened, changed labels)
  119.  
  120. * 
  121. * ----------------------------------------------------------------------
  122. * @(2)  Make Column Block of Longest Line in Paragraph,
  123. *       Include Leading Spaces
  124. * ----------------------------------------------------------------------
  125. * This macro will make a paragraph a column block of longest line in
  126. * paragraph.
  127.  
  128. @2      macrobegin
  129.         setscreenoff
  130.         endpara prevpara
  131.         begline unmarkblock markcolumn endline
  132.      1: cursorleft markcolumn cursordown begline endline jtrue 1
  133.         gotoblockbeg
  134. * 31 bytes Sat  11-02-1991  17:45:51 (TH @2, #3/758 as @5)
  135. * 24 bytes Sun  11-10-1991  16:25:36 (TH @2, shortened)
  136. * 23 bytes Wed  11-20-1991  09:25:50 (TH @2, shortened #3/774)
  137. * 19 bytes Sat  12-07-1991  14:35:32 (TH @2, shortened, mark all para)
  138. * 19 bytes Sun  04-26-1992  11:28:45 (TH @2, changed start)
  139. * 20 bytes Sun  04-26-1992  12:08:39 (TH @2, include setscreenoff )
  140. * 20 bytes Tue  04-28-1992  08:22:19 (TH @2, changed labels)
  141.  
  142. * 
  143. * ----------------------------------------------------------------------
  144. * @(3)  Make Column Block Longest Line, Exclude Leading Spaces
  145. * ----------------------------------------------------------------------
  146. * This macro works like @1 except the column width is equal to the
  147. * actual text length of the longest line in the marked block excluding
  148. * leading spaces.
  149.  
  150. * At the 'pause', cursor down to select lines, and press <enter> to make a
  151. * column block of the longest lines selected.  Alternatively, lines may
  152. * be marked as an open or closed line, character or column before macro
  153. * execution.  Macro requires QEdit v2.15.
  154.  
  155. * See @f8 in rfr003.qm for example using this macro.
  156.  
  157. @3      macrobegin
  158.         gotoblockend jtrue A  markline gotoblockend jtrue OK  pause jump B *|
  159.      A: gotoblockbeg unmarkblock markline prevposition                     *|
  160.      B: markline                                                           *|
  161.     OK: setscreenoff
  162.      1: begline addline "*" #173 gotoblockbeg                              *|
  163.      2: isemptyline jfalse 3 cursordown jump 2
  164.      3: firstnonwhite markcolumn endline cursorleft
  165.      4: cursordown isemptyline jtrue 4 isendline jtrue 5 endline cursorleft
  166.      5: markcolumn Find "*" #173 return delline return jfalse 6
  167.         prevposition firstnonwhite iscursorinblock jtrue 4 markcolumn jump 4
  168.      6: delline gotoblockbeg
  169. *
  170. * 75 bytes Mon  11-11-1991  12:04:12 (TH @3)
  171. * 87 bytes Wed  11-20-1991  11:14:52 (TH @3, corrected for empty lines #3/774)
  172. * 79 bytes Sat  04-25-1992  13:42:48 (TH @3, shortened, changed labels)
  173. * 77 bytes Tue  04-28-1992  08:03:29 (TH @3, shortened)
  174.  
  175. * 
  176. * ----------------------------------------------------------------------
  177. * @(4)  Convert Any Type Block to Column Block 73 Column Wide,
  178. *       Include Leading Spaces
  179. * ----------------------------------------------------------------------
  180. * This macro will convert any type open or closed block to 73 column
  181. * wide column block.  Change 73 to any desired width.  Single line
  182. * blocks are excluded.
  183.  
  184. @4      macrobegin setscreenoff
  185.         gotoblockbeg jtrue A  markline gotoblockbeg jtrue A
  186.         unmarkblock jump END
  187.      A: begline gotoblockend prevposition markcolumn                       *|
  188.         prevposition gotocolumn "73" return markcolumn gotoblockbeg
  189.    END:
  190. *
  191. * 54 bytes Thu  11-07-1991  22:44:08 (TH @4 #3/758 as @2)
  192. * 32 bytes Sun  11-10-1991  19:05:38 (TH @4, shortened, #3/774)
  193. * 31 bytes Tue  04-28-1992  08:28:45 (TH @4, shortened)
  194.  
  195. * 
  196. * ----------------------------------------------------------------------
  197. * @(5)  Make Column Block of Longest Line in Paragraph,
  198. *       Exclude Leading Spaces
  199. * ----------------------------------------------------------------------
  200. * This macro will make a paragraph a column block of longest line in
  201. * paragraph.  See @f9 in rfr003.qm for example using this macro.
  202.  
  203. @5      macrobegin savesettings setautoindentmode setsoundoff
  204.         setscreenoff
  205.         endpara prevpara            * Move to para begin
  206.         firstnonwhite               * Pos first char current line
  207.         unmarkblock markcolumn      * Start column block
  208.         endline cursorleft          * Make line 1 column block
  209.      1: cursordown jfalse 3         * Move down to next line
  210.         isemptyline jtrue 4         *ELSE not eof, test if end of para
  211.         markcolumn                  *ELSE not end of para, extend block
  212.         firstnonwhite               * Move to first char
  213.         iscursorinblock jtrue 2     * Test if in block
  214.         markcolumn                  *ELSE not in block, extend block
  215.         gotoblockend cursorleft     * Pos to test if past eol
  216.      2: isendline jtrue 1           * Test if past eol, loop again if true
  217.         endline cursorleft jump 1   *ELSE inlcude eol in block, loop again
  218.      3:
  219.      4: gotoblockbeg                * Pos block begin
  220.         restoresettings
  221. *
  222. * 43 bytes Sun  04-26-1992  12:05:29 (TH @5)
  223.  
  224. * 
  225. * ----------------------------------------------------------------------
  226. * @(6)  Make Column Block of Longest Line in File,
  227. *       Include Leading Spaces
  228. * ----------------------------------------------------------------------
  229. * This macro will make a file a column block of longest line in the
  230. * file.  This technique is primarily for use in other macros like in @7
  231. * and @0 in MSGxx.QM.
  232.  
  233. @6      macrobegin
  234.         setscreenoff                                                       *|
  235.         begfile unmarkblock markcolumn
  236.      1: endline cursorleft markcolumn cursordown jtrue 1
  237.         begfile
  238. *
  239. * 22 bytes Tue  11-19-1991  23:40:49 (TH @6, #3/774)
  240. * 18 bytes Sat  12-07-1991  14:39:44 (TH @6, shortened)
  241. * 16 bytes Sun  04-26-1992  12:09:50 (TH @6, include setscreenoff, shortened)
  242.  
  243. * 
  244. * ----------------------------------------------------------------------
  245. * @(7)  Make Column Block of Longest Line in Column or Character Block,
  246. *       Use Nul, Include Leading Spaces
  247. * ----------------------------------------------------------------------
  248. * This macro will make a column block of the longest line in a column
  249. * or character block.  It will not work with line blocks.  This
  250. * technique is used in dsiz@1.qm @1.
  251.  
  252. @7      macrobegin
  253.         setscreenoff
  254.         editfile "nul" return quit gotoblockbeg jfalse END
  255.         editfile return
  256.         copyblock unmarkblock markcolumn
  257.      1: endline cursorleft markcolumn cursordown jtrue 1
  258.         copy quit pasteover
  259.     END:
  260. *
  261. * 33 bytes Sun  04-26-1992  14:46:38 (TH @7)
  262.  
  263. * 
  264. * ----------------------------------------------------------------------
  265. * @(8)  Make Column Block 20 Tab Stops Wide, Exclude Leading Spaces
  266. * ----------------------------------------------------------------------
  267. * At the 'pause', cursor down to select lines, and press <enter> to
  268. * make a 20 Tab stop wide column block excluding leading spaces.
  269. * Alternatively, lines may be marked as an open or closed line,
  270. * character or column before macro execution.
  271.  
  272. * The same block marking could be achieved using "gotocolumn nn
  273. * return", but this macro is intended to not change the last entry in
  274. * the "goto column" prompt.  Macro requires QEdit v2.15.
  275.  
  276. @8      macrobegin setinsmode toggleinsert
  277.         gotoblockend jtrue A  markline gotoblockend jtrue OK  pause jump B *|
  278.      A: gotoblockbeg unmarkblock markline prevposition                     *|
  279.      B: markline                                                           *|
  280.     OK: setscreenoff
  281.      1: begline addline "*" #173 gotoblockbeg                              *|
  282.      2: isemptyline jfalse 3 cursordown jump 2
  283.      3: tabrt 20 markcolumn firstnonwhite markcolumn
  284.      4: cursordown isemptyline jtrue 4
  285.         Find "*" #173 return delline return jfalse 6
  286.         prevposition firstnonwhite markcolumn jump 4
  287.      6: delline gotoblockbeg
  288. *
  289. * 76 bytes Mon  04-27-1992  15:43:06 (TH @8)
  290. * 74 bytes Tue  04-28-1992  08:36:52 (TH @8, shortened)
  291.  
  292.